package com.dailyblue.example.springcloud.consumer.ribbon.controller;

import com.dailyblue.example.springcloud.commons.util.JsonResult;
import com.dailyblue.example.springcloud.consumer.ribbon.service.ConsumerRibbonService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/consumer_ribbon")
@RestController
public class ConsumerRibbonController {
    @Resource
    private ConsumerRibbonService service;

    @GetMapping("/a")
    public JsonResult a() {
        return service.a();
    }

    @GetMapping("/b")
    public JsonResult b(int a) {
        return service.b(a);
    }

    @GetMapping("/c/{a}")
    public JsonResult c(@PathVariable int a) {
        return service.c(a);
    }
}
